# from PIL import Image
# import os
#
#
# folder_path = r'C:\pycharm_proj\svg_convert\cir_output'
# for filename in os.listdir(folder_path):
#     if filename.lower().endswith('.png'):
#         file_path = os.path.join(folder_path,filename)
#         img = Image.open(file_path).convert('RGBA')
#         pixels = img.getdata()
#         unique_colors = set(pixels)
#         print(f"{filename} 包含 {len(unique_colors)} 种颜色")
#         for i, px in enumerate(pixels):
#             print(f"像素 {i}: {px}")
#



from PIL import Image
import os

folder_path = r'/cir_output'

for filename in os.listdir(folder_path):
    if filename.lower().endswith('.png'):
        file_path = os.path.join(folder_path, filename)
        img = Image.open(file_path).convert('RGBA')
        pixels = img.getdata()

        alpha_values = set()
        for px in pixels:
            alpha_values.add(px[3])  # 只取 Alpha 通道值

        sorted_alpha = sorted(list(alpha_values))
        print(f"{filename} 有 {len(alpha_values)} 种 Alpha 通道值： {sorted_alpha}")

